package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * DcInfDetalle generated by hbm2java
 */
@Entity
@Table(name = "DC_INF_DETALLE", schema = "EDADEPUDOC")
public class DcInfDetalle implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4949937753183535195L;
	private DcInfDetalleId id;
	private DcInfImprenta dcInfImprenta;
	private ImTipoDocum imTipoDocum;
	private String nnrc;
	private Long ncomprobanteCred;
	private String cerror;
	private String ninicial;
	private String nfinal;
	private String nautorizaEmision;
	private Set<ImErrorInf> imErrorInfs = new HashSet<ImErrorInf>(0);

	public DcInfDetalle() {
	}

	public DcInfDetalle(DcInfDetalleId id, DcInfImprenta dcInfImprenta,
			ImTipoDocum imTipoDocum, String nnrc, Long ncomprobanteCred) {
		this.id = id;
		this.dcInfImprenta = dcInfImprenta;
		this.imTipoDocum = imTipoDocum;
		this.nnrc = nnrc;
		this.ncomprobanteCred = ncomprobanteCred;
	}

	public DcInfDetalle(DcInfDetalleId id, DcInfImprenta dcInfImprenta,
			ImTipoDocum imTipoDocum, String nnrc, Long ncomprobanteCred,
			String cerror, String ninicial, String nfinal,
			String nautorizaEmision, Set<ImErrorInf> imErrorInfs) {
		this.id = id;
		this.dcInfImprenta = dcInfImprenta;
		this.imTipoDocum = imTipoDocum;
		this.nnrc = nnrc;
		this.ncomprobanteCred = ncomprobanteCred;
		this.cerror = cerror;
		this.ninicial = ninicial;
		this.nfinal = nfinal;
		this.nautorizaEmision = nautorizaEmision;
		this.imErrorInfs = imErrorInfs;
	}

	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "iindice", column = @Column(name = "I_INDICE", nullable = false, precision = 18, scale = 0)),
			@AttributeOverride(name = "ncorrela", column = @Column(name = "N_CORRELA", nullable = false, precision = 10, scale = 0)) })
	public DcInfDetalleId getId() {
		return this.id;
	}

	public void setId(DcInfDetalleId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "I_INDICE", nullable = false, insertable = false, updatable = false)
	public DcInfImprenta getDcInfImprenta() {
		return this.dcInfImprenta;
	}

	public void setDcInfImprenta(DcInfImprenta dcInfImprenta) {
		this.dcInfImprenta = dcInfImprenta;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_TIPO_DOCUMENTO", nullable = false)
	public ImTipoDocum getImTipoDocum() {
		return this.imTipoDocum;
	}

	public void setImTipoDocum(ImTipoDocum imTipoDocum) {
		this.imTipoDocum = imTipoDocum;
	}

	@Column(name = "N_NRC", nullable = false, length = 8)
	public String getNnrc() {
		return this.nnrc;
	}

	public void setNnrc(String nnrc) {
		this.nnrc = nnrc;
	}

	@Column(name = "N_COMPROBANTE_CRED", nullable = false, precision = 10, scale = 0)
	public Long getNcomprobanteCred() {
		return this.ncomprobanteCred;
	}

	public void setNcomprobanteCred(Long ncomprobanteCred) {
		this.ncomprobanteCred = ncomprobanteCred;
	}

	@Column(name = "C_ERROR", length = 3)
	public String getCerror() {
		return this.cerror;
	}

	public void setCerror(String cerror) {
		this.cerror = cerror;
	}

	@Column(name = "N_INICIAL", length = 20)
	public String getNinicial() {
		return this.ninicial;
	}

	public void setNinicial(String ninicial) {
		this.ninicial = ninicial;
	}

	@Column(name = "N_FINAL", length = 20)
	public String getNfinal() {
		return this.nfinal;
	}

	public void setNfinal(String nfinal) {
		this.nfinal = nfinal;
	}

	@Column(name = "N_AUTORIZA_EMISION", length = 16)
	public String getNautorizaEmision() {
		return this.nautorizaEmision;
	}

	public void setNautorizaEmision(String nautorizaEmision) {
		this.nautorizaEmision = nautorizaEmision;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dcInfDetalle")
	public Set<ImErrorInf> getImErrorInfs() {
		return this.imErrorInfs;
	}

	public void setImErrorInfs(Set<ImErrorInf> imErrorInfs) {
		this.imErrorInfs = imErrorInfs;
	}

}
